I have an attribute DXL script which is causing a memory leak. The script interrogates a large compound filter (maybe 100+ rules) which causes a memory leak when scrolling through any module view displaying the attribute (due to repeated interrogation of the filter description for each newly displayed object).
Module mCur = current
Filter fCur = current Filter
string strFilter = ""
if (!null fCur)
{
strFilter = stringOf (mCur, fCur)
}
// code to process strFilter
obj.attrDXLName = richText strFilter
Martin Hunter
Martin_Hunter - Tue Oct 16 05:38:19 EDT 2012 |
Re: Memory leak - stringOf (Filter) Try: Module mCur = current Filter fCur = current Filter if (null fCur)obj.attrDXLName=" " obj.attrDXLName = richText( stringOf (mCur, fCur)) |
Re: Memory leak - stringOf (Filter) OurGuest - Tue Oct 16 10:00:12 EDT 2012 Try: Module mCur = current Filter fCur = current Filter if (null fCur)obj.attrDXLName=" " obj.attrDXLName = richText( stringOf (mCur, fCur)) {code} Module mCur = current Filter fCur = current Filter if (null fCur)obj.attrDXLName=" " else obj.attrDXLName = richText( stringOf (mCur, fCur)) {code |
Re: Memory leak - stringOf (Filter) Let me violate natural Attr-DXL context guidelines:
Module mCur = module(obj)
current = mCurr
Filter fCur = current Filter
string strFilter = ""
if (!null fCur) //
then strFilter = stringOf (mCur, fCur)
else strFilter = "no filter"
Object o
for o in entire(mCur) do
{ if (isVisible(o) or
obj == o) o.attrDXLName = strFilter // or richText(strFilter) if you prefer
}
|
Re: Memory leak - stringOf (Filter) llandale - Tue Oct 16 13:51:10 EDT 2012 Let me violate natural Attr-DXL context guidelines:
Module mCur = module(obj)
current = mCurr
Filter fCur = current Filter
string strFilter = ""
if (!null fCur) //
then strFilter = stringOf (mCur, fCur)
else strFilter = "no filter"
Object o
for o in entire(mCur) do
{ if (isVisible(o) or
obj == o) o.attrDXLName = strFilter // or richText(strFilter) if you prefer
}
Thanks for your help and ideas. I was trying Louie's idea, then tried replacing strFilter with stringOf (current Module, current Filter) wherever used in the code and the leak has been plugged. Sample code was simple to demonstrate memory leak. Martin Hunter |
Re: Memory leak - stringOf (Filter) Martin_Hunter - Wed Oct 17 01:31:53 EDT 2012 |